<%-- 
    Document   : listRecensori
    Created on : 25-mag-2013, 10.57.58
    Author     : Rob
--%>

<%@page import="ejb.Utente"%>
<%@page import="java.util.List"%>
<%@page import="ejb.ArticoloUsato"%>
<%@include file="wrapper.jsp" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%
    Utente utSession = (Utente)session.getAttribute("utente");
    String tipo = utSession.getTipo();
%>
<div class="container">
   <div class="row-fluid">
        <div class="span3 bs-docs-sidebar">
            <ul class="nav nav-list bs-docs-sidenav">
                <li><a href="Controller?button=visualizzaRecensori"> 
                <button class="btn btn-large btn-inverse btn-block" style="width:210px"><i class="icon-white icon-th-list"></i> Gestisci Recensori</button> </a></li>
            </ul>
        </div>   
        <div class="span6">   
            <div class="thumbnail">
            <h3>Elenco Recensori</h3>
             <form action="Controller" method="POST">
                <table class="table table-hover">
                <%
                List<ArticoloUsato> usatiDaConfermare= (List<ArticoloUsato>)session.getAttribute("usatiDaConfermare");
                List<Utente> recensori= (List<Utente>)request.getAttribute("recensori");
                for(Utente r:recensori){  
                %>  
                <tr>
                    <td style="width:330px"><%=r.getUsername()%></td> 
                    <td><a href="Controller?button=cancellaRecensore&idRecensore=<%=r.getId()%>"> <button class="btn btn-inverse btn-small" type="button"><i class="icon-white icon-trash"></i> Rimuovi</button>  </a> </td> 
                </tr>
                <%}%>
                </table>
                <hr>
                <h3>Elenco Users</h3>
                <table class="table table-hover">
                  <%
                List<Utente> users= (List<Utente>)request.getAttribute("users");
                for(Utente u:users){  
                %>  
                <tr>
                    <td style="width:330px"><%=u.getUsername()%></td> 
                    <td><a href="Controller?button=cancellaUtente&idUser=<%=u.getId()%>"> <button class="btn btn-inverse btn-small" type="button"><i class="icon-white icon-trash"></i> Rimuovi</button>  </a> </td> 
                </tr>
                <%}%>
                </table>
                <hr>
               
                <table class="table table-hover">
                  <%
                    List<Utente> disable= (List<Utente>)request.getAttribute("disable");
                    if (disable!=null){
                    for(Utente u:disable){  
                %>  
                 <h3>Elenco Users</h3>
                <tr>
                    <td style="width:330px"><%=u.getUsername()%></td> 
                    <td><a href="Controller?button=abilitaUtente&idUtente=<%=u.getId()%>"> <button class="btn btn-inverse btn-small" type="button"><i class="icon-white icon-trash"></i> Abilita</button>  </a> </td> 
                </tr>
                <%}}%>
                </table>
             </form>
        </div>
        </div>
        <div class="span3">
                <div class="thumbnail">
                 <p><b>Notes</b></p>
                 <br>
                 <% if(!usatiDaConfermare.isEmpty()){%>
                    <p> Ancora <%=usatiDaConfermare.size()%> articoli da confermare </p>
                    <br>
                    <p align="center">
                        <a href="Controller?button=modificaCancellaArtUsati&amp;confirm=s">
                            <button class="btn btn-inverse btn-small"><i class="icon-white icon-th-list"></i> Vedi Articoli da confermare</button>
                        </a>
                    </p>
                 <%}else{%>
                 <p> Nessun articolo da confermare </p>
                <%}%>      
            </div>
           
         </div>          
   </div>
</div>
</body>
